# @Version        : 1.0
# @Update Time    : 2024/12/9 22:44
# @File           : jwt_refresh_middleware.py
# @IDE            : PyCharm
# @Desc           : jwt刷新中间件
from fastapi import FastAPI, Request


async def register_jwt_refresh_middleware(app: FastAPI) -> None:
    """
    注册jwt刷新中间件，当过期时间小于30分钟时，刷新过期时间添加一个小时
    :param app:
    :return:
    """

    @app.middleware("http")
    async def jwt_refresh_middleware(request: Request, call_next):
        """
        jwt刷新中间件
        :param request:
        :param call_next:
        :return:
        """
        pass
